<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>MecGridLargeData.mxml</title>
<link rel="stylesheet" type="text/css" href="../../SourceStyles.css"/>
</head>

<body><pre><span class="MXMLProcessing_Instruction">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</span>
<span class="MXMLComponent_Tag">&lt;mx:Canvas</span><span class="MXMLDefault_Text"> xmlns:mx=&quot;</span><span class="MXMLString">http://www.adobe.com/2006/mxml</span><span class="MXMLDefault_Text">&quot; width=&quot;</span><span class="MXMLString">400</span><span class="MXMLDefault_Text">&quot; height=&quot;</span><span class="MXMLString">300</span><span class="MXMLDefault_Text">&quot; xmlns:MecGrid=&quot;</span><span class="MXMLString">com.mechan.MecGrid.*</span><span class="MXMLDefault_Text">&quot; creationComplete=&quot;</span><span class="ActionScriptDefault_Text">initApp</span><span class="ActionScriptBracket/Brace">()</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
<span class="MXMLSpecial_Tag">&lt;mx:Script&gt;</span>
    <span class="ActionScriptOperator">&lt;!</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">CDATA</span><span class="ActionScriptBracket/Brace">[</span>
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">collections</span>.<span class="ActionScriptDefault_Text">ArrayCollection</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">IFlexDisplayObject</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">managers</span>.<span class="ActionScriptDefault_Text">PopUpManager</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">CloseEvent</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">controls</span>.<span class="ActionScriptDefault_Text">Alert</span>;
        
        <span class="ActionScriptComment">// This demonstrates how you can set MecGrid properties by XML.
</span>        <span class="ActionScriptComment">// You can build ResourceXML With MecGridWizard by Exporting and copy to clipboard the source XML.
</span>        <span class="ActionScriptComment">//
</span>        <span class="ActionScriptComment">// Reversely you can set the property of XML String to Binary data and vice versa.
</span>        <span class="ActionScriptComment">// 
</span>        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">dpcol</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">ArrayCollection</span>;
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">dp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span>;
                                
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">initApp</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptComment">// applyDataProvider();
</span>        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">MakeData</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span>;
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">n</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> 0;
            
            <span class="ActionScriptDefault_Text">dp</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">()</span>;
            
            <span class="ActionScriptReserved">for</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">=</span>0; <span class="ActionScriptDefault_Text">i</span> <span class="ActionScriptOperator">&lt;</span> <span class="ActionScriptDefault_Text">dpcnt</span>.<span class="ActionScriptDefault_Text">value</span>; <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">++</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">obj</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Object</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Object</span><span class="ActionScriptBracket/Brace">()</span>;
                <span class="ActionScriptDefault_Text">obj</span>.<span class="ActionScriptDefault_Text">selected</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
                <span class="ActionScriptDefault_Text">obj</span>.<span class="ActionScriptDefault_Text">country</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;cntr&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">i</span>;
                <span class="ActionScriptDefault_Text">obj</span>.<span class="ActionScriptDefault_Text">city</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;city&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">i</span>;
                <span class="ActionScriptDefault_Text">obj</span>.<span class="ActionScriptDefault_Text">qt1</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">random</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">*</span> 100;
                <span class="ActionScriptDefault_Text">obj</span>.<span class="ActionScriptDefault_Text">qt2</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">random</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">*</span> 100;
                <span class="ActionScriptDefault_Text">obj</span>.<span class="ActionScriptDefault_Text">qt3</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">random</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">*</span> 100;
                <span class="ActionScriptDefault_Text">obj</span>.<span class="ActionScriptDefault_Text">qt4</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">random</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">*</span> 100;
                
                <span class="ActionScriptDefault_Text">dp</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">obj</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>

            <span class="ActionScriptDefault_Text">dpcol</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ArrayCollection</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">dp</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptDefault_Text">Alert</span>.<span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">dpcnt</span>.<span class="ActionScriptDefault_Text">value</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot; Data Created. Click Draw Data button to display in MecGrid control!&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">LoadData</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">dpcol</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Alert</span>.<span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;Click Make Data Button first!&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptReserved">return</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">dataProvider</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">dpcol</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">]]</span><span class="ActionScriptOperator">&gt;</span>
<span class="MXMLSpecial_Tag">&lt;/mx:Script&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">lblTitle</span><span class="MXMLDefault_Text">&quot; x=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">LARGE DATA BINDING</span><span class="MXMLDefault_Text">&quot; styleName=&quot;</span><span class="MXMLString">demoTitle</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:VBox</span><span class="MXMLDefault_Text"> right=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; top=&quot;</span><span class="MXMLString">49</span><span class="MXMLDefault_Text">&quot; bottom=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; left=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:HBox</span><span class="MXMLDefault_Text"> width=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:NumericStepper</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">dpcnt</span><span class="MXMLDefault_Text">&quot; minimum=&quot;</span><span class="MXMLString">100</span><span class="MXMLDefault_Text">&quot; maximum=&quot;</span><span class="MXMLString">10000000</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:Button</span><span class="MXMLDefault_Text"> label=&quot;</span><span class="MXMLString">Make Data</span><span class="MXMLDefault_Text">&quot; click=&quot;</span><span class="ActionScriptDefault_Text">MakeData</span><span class="ActionScriptBracket/Brace">()</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:Button</span><span class="MXMLDefault_Text"> label=&quot;</span><span class="MXMLString">Draw Data</span><span class="MXMLDefault_Text">&quot; click=&quot;</span><span class="ActionScriptDefault_Text">LoadData</span><span class="ActionScriptBracket/Brace">()</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;/mx:HBox&gt;</span>
        <span class="MXMLComponent_Tag">&lt;MecGrid:MecGrid</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">mgrid</span><span class="MXMLDefault_Text">&quot; width=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot; height=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;MecGrid:ResourceXML&gt;</span>
                <span class="MXMLSpecial_Tag">&lt;mx:XML</span><span class="MXMLDefault_Text"> xmlns=&quot;</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLSpecial_Tag">&gt;</span>
                    <span class="MXMLProcessing_Instruction">&lt;List&gt;
                      &lt;option cols=&quot;7&quot; fixedrows=&quot;2&quot; fixedcols=&quot;0&quot; merge_option=&quot;4&quot; merge_option_fixedcolumn=&quot;0&quot; merge_option_fixedrow=&quot;2&quot; showspreadsheet=&quot;F&quot; selectionmode=&quot;18&quot; treeview=&quot;T&quot; treeColumn=&quot;0&quot; textalignment=&quot;6&quot; textalignment_fixed=&quot;5&quot;/&gt;
                      &lt;columns&gt;
                        &lt;column name=&quot;col_0&quot; datafield=&quot;selected&quot; visible=&quot;T&quot; editable=&quot;F&quot; colindex=&quot;0&quot; autowidth=&quot;T&quot; width=&quot;41&quot; datatype=&quot;0&quot; textalign=&quot;5&quot; textalign_fixed=&quot;10&quot; formatstring=&quot;&quot; header=&quot;Select;Select&quot;/&gt;
                        &lt;column name=&quot;col_1&quot; datafield=&quot;country&quot; visible=&quot;T&quot; editable=&quot;F&quot; colindex=&quot;1&quot; autowidth=&quot;T&quot; width=&quot;61&quot; datatype=&quot;5&quot; textalign=&quot;4&quot; textalign_fixed=&quot;10&quot; formatstring=&quot;&quot; header=&quot;Country;Country&quot;/&gt;
                        &lt;column name=&quot;col_2&quot; datafield=&quot;city&quot; visible=&quot;T&quot; editable=&quot;F&quot; colindex=&quot;2&quot; autowidth=&quot;T&quot; width=&quot;61&quot; datatype=&quot;5&quot; textalign=&quot;4&quot; textalign_fixed=&quot;10&quot; formatstring=&quot;&quot; header=&quot;City;City&quot;/&gt;
                        &lt;column name=&quot;col_3&quot; datafield=&quot;qt1&quot; visible=&quot;T&quot; editable=&quot;F&quot; colindex=&quot;3&quot; autowidth=&quot;T&quot; width=&quot;88&quot; datatype=&quot;5&quot; textalign=&quot;10&quot; textalign_fixed=&quot;10&quot; formatstring=&quot;#,###.##&quot; header=&quot;Visitors;1st Quater (A)&quot;/&gt;
                        &lt;column name=&quot;col_4&quot; datafield=&quot;qt2&quot; visible=&quot;T&quot; editable=&quot;F&quot; colindex=&quot;4&quot; autowidth=&quot;T&quot; width=&quot;92&quot; datatype=&quot;5&quot; textalign=&quot;10&quot; textalign_fixed=&quot;10&quot; formatstring=&quot;#,###.##&quot; header=&quot;Visitors;2nd Quater (B)&quot;/&gt;
                        &lt;column name=&quot;col_5&quot; datafield=&quot;qt3&quot; visible=&quot;T&quot; editable=&quot;F&quot; colindex=&quot;5&quot; autowidth=&quot;T&quot; width=&quot;90&quot; datatype=&quot;5&quot; textalign=&quot;10&quot; textalign_fixed=&quot;10&quot; formatstring=&quot;#,###.##&quot; header=&quot;Visitors;3rd Quater (C)&quot;/&gt;
                        &lt;column name=&quot;col_6&quot; datafield=&quot;qt4&quot; visible=&quot;T&quot; editable=&quot;F&quot; colindex=&quot;6&quot; autowidth=&quot;T&quot; width=&quot;90&quot; datatype=&quot;5&quot; textalign=&quot;10&quot; textalign_fixed=&quot;10&quot; formatstring=&quot;#,###.##&quot; header=&quot;Visitors;4th Quater (D)&quot;/&gt;
                      &lt;/columns&gt;
                    &lt;/List&gt;</span>    
                <span class="MXMLSpecial_Tag">&lt;/mx:XML&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/MecGrid:ResourceXML&gt;</span>
        <span class="MXMLComponent_Tag">&lt;/MecGrid:MecGrid&gt;</span>
    <span class="MXMLComponent_Tag">&lt;/mx:VBox&gt;</span>
    
    
<span class="MXMLComponent_Tag">&lt;/mx:Canvas&gt;</span></pre></body>
</html>
